//
//  BaseInfoController.m
//  SalonManage
//
//  Created by wulongmin on 17/7/12.
//  Copyright © 2017年 lmtt. All rights reserved.
//

#import "BaseInfoController.h"
#import "HTTPHelper+Emp.h"

@interface BaseInfoController ()
@property (weak, nonatomic) IBOutlet UITextField *unitIDField;
@property (weak, nonatomic) IBOutlet UITextField *stationnoField;

@end

@implementation BaseInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}


- (IBAction)saveClick:(id)sender {
    
    if (!self.unitIDField.text.length) {
        [MBProgressHUD showText:@"unit_id不能为空" onView:nil];
        return;
    }
    if (!self.stationnoField.text.length) {
        [MBProgressHUD showText:@"stationno不能为空" onView:nil];
        return;
    }
    
    //请求unit_id和stationno的是否可用
    HTTPHelper *httpTool = [HTTPHelper sharedHTTPHelper];
    [httpTool checkUnitId:self.unitIDField.text stationNo:self.stationnoField.text success:^{
       
        [self quit:nil];
    }];
}

- (IBAction)quit:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
    
}


@end
